program CHECK_BR2;
uses crt;
const
  fi = 'br2.out';
  max = 51;
var
  a : array[1..max, 1..max] of longint;
  s : array[1..max] of integer;
  p : array[1..1000] of longint;
  m, l : longint;

function prime(k : longint) : boolean;
var
  i, c : longint;
begin
  prime := false;
  c := trunc(sqrt(k));
  for i := 1 to l do
  begin
    if p[i] > c then break;
    if k mod p[i] = 0 then exit;
  end;
  prime := true;
end;

function bess(n : longint) : longint;
var
  i, m, temp : longint;
  res : longint;
begin
  m := n;
  res := 1;
  for i := 1 to l do
    if n mod p[i] = 0 then
    begin
      temp := p[i];
      while n mod p[i] = 0 do
      begin
        temp := temp*p[i];
        n := n div p[i];
      end;
      res := res * ((temp - 1) div (p[i] - 1));
    end;
  if n <> 1 then res := res*(n+1);
  dec(res, m);
  bess := res;
end;

procedure init;
var
  i : longint;
begin
  l := 0;
  for i := 2 to 1500 do
    if prime(i) then
    begin
      inc(l);
      p[l] := i;
    end;
end;

procedure inp;
begin
  m := 0;
  while not eof do
  begin
    inc(m);
    s[m] := 0;
    while not seekeoln do
    begin
      inc(s[m]);
      read(a[m, s[m]]);
    end;
    a[m, s[m]+1] := a[m, 1];
    readln;
  end;
end;

function check(k : integer) : boolean;
var
  i, j : integer;
  u : longint;
begin
  check := false;
  for i := 1 to s[k] do
  begin
    u := bess(a[k, i]);
    if a[k, i+1] <> u then exit;
  end;
  check := true;
end;

procedure process;
var
  i : integer;
begin
  for i := 1 to m do
    if not check(i) then
    begin
      writeln('Sai day ', i);
      exit;
    end;
  writeln('So day ', m, ' Cha biet dung hay sai nua:(, hoi ku Hiu xem');
end;

begin
  clrscr;
  assign(input, fi); reset(input);
  init;
  inp;
  process;
  close(input);
end.